package com.neoz.demo.javabasic;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;

public class UrlConn {

	public static void main(String[] args) throws IOException {
		URL google = new URL("http://www.google.com");
		URLConnection g = google.openConnection();
		BufferedReader in = new BufferedReader(new InputStreamReader(
				g.getInputStream()));
		String inputLine;
		while ((inputLine = in.readLine()) != null)
			System.out.println(inputLine);
		in.close();
	}

}
